/*
 * EGSETest.cpp
 *
 *  Created on: 08.06.2011
 *      Author: user
 */

#include <rodos.h>
#include "EGSETest.h"
static Application testingApplication("Random Name");

EGSETest::EGSETest():messageSubscriber(nmx,Interface){

}

void EGSETest::run(){
	PRINTF(SCREEN_CLEAR);
	while(1){
		waitUntil(NOW()+1*SECONDS);
		PRINTF(SCREEN_CLEAR);
		PRINTF(SCREEN_MOVE_CURSOR_TO, 1, 1);
		PRINTF("NodeID");
		PRINTF(SCREEN_MOVE_CURSOR_TO, 1, 10);
		PRINTF("Enabled");
		PRINTF(SCREEN_MOVE_CURSOR_TO, 1, 20);
		PRINTF("Worker");
		PRINTF(SCREEN_MOVE_CURSOR_TO, 1, 30);
		int Nodecount = Interface.getNumNodes();
		PRINTF("Nodecount %d\n\n",Nodecount);

		int* nodeList = Interface.getNodeIDList();
		int WorkerID = Interface.getWorkerID();

		for(int i=0;i<=Nodecount-1;i++){
			PRINTF(SCREEN_MOVE_CURSOR_TO, 2+i, 3);
			PRINTF("%d",nodeList[i]);

			PRINTF(SCREEN_MOVE_CURSOR_TO, 2+i, 12);
				PRINTF("true");

			PRINTF(SCREEN_MOVE_CURSOR_TO, 2+i, 21);
			if(nodeList[i] == WorkerID){
				PRINTF("true");
			}
		}
	}
}
